1. Field of the Invention
The invention generally relates to a frequency synchronizing apparatus, and particularly to a frequency synchronizing apparatus and a method of synchronizing real-time data transmission via USB.
2. Description of the Related Art
In recent years interfaces for data transmission between various electronic devices have been abundantly designed as the electronic industry is growing fast. USB has been widely used as the transmission interface for computer platforms due to its mature specification.
The USB specification includes four types of data transmission: control type, interrupt type, bulk type and isochronous type. Each transfer type suits its corresponding application. For example, isochronous data transmission, or interrupt data transmission is needed for those products that need continuous and real-time data transmission such as USB voice communication appliances or USB loud speakers.
For the USB with isochronous data transmission, a predetermined amount of data is transmitted with a constant cycle time each time. For example, the internet voice telephone uses a microphone to receive sound and converts the sound via an analog/digital converter (ADC). The sound samples are digitized and sampled at sampling rate of 16K/sec. The sampled data is transmitted with the isochronous transfer type of data transmission at 16 sound samples per 1 ms to a master device. For the master device, it receives sampled voice data at the rate of 16 sound samples per 1 ms with the isochronous transfer type of data transmission.
However, when the sampled data is transmitted with the isochronous transfer type of data transmission, there is always a non-synchronous transmission between the master device and the slave device. Besides, the master device and the slave device each have a system frequency oscillator which operate at slightly different frequencies. The frequency difference accumulates continuously as time elapses. When the accumulated sum of frequency differences is large, the data transmitted from the master device will be more than the data received by the slave device if the master device operates at higher frequency than the slave device, and therefore the slave device will dump some data transmitted from the master device. On the other hand, if the master operates at lower frequency than the slave device, the data transmitted from the master device will be less than the data received by the slave device, and therefore the slave device will create itself some sound data to compensate for the missing data. In both cases, i.e. if the master device operates at higher frequency or at lower frequency than the slave device, the frequency difference between them will generate noises which deteriorate the data transmission quality.
One approach has been proposed to use an analog phase lock loop to obtain a UBS bus clock so as to synchronize the frequencies of the master device and the slave device. In this approach, if the analog phase lock loop cannot work quite well, the frequency difference between the master device and the slave device inevitably generates. Another approach which uses a controller firmware for the slave device has also been proposed. However, the improvement made by using the firmware for the devices is not as good as made by modifying the hardware of the devices. In addition, different controller manufacturers have their own specifications for the controllers, making the improvement of the devices complicate.
Furthermore, if the master device uses an over-sampling analog/digital converter or digital/analog converter, in addition to the sampling clock, the relationship between the sampling speed and the over-sampling clock should be also well controlled. Even if the above analog phase lock loop is used, there is an additional need of relevant circuit matching the analog phase lock loop, increasing the difficulty of chip design and the cost of manufacture and test. No other currently available approaches can completely solve the problem of frequency differences between the master device and the slave device.